{{ if site.Config.Services.Disqus.Shortname }}
<article>
  {{ partial "disqus.html" (dict "Context" . "Identifier" .RelPermalink) }}
</article>
{{ end }}

{{ if site.Params.utterancesRepo }}
<template x-if="['localhost', '127.0.0.1'].indexOf(window.location.hostname) == -1">
  <article>
    <script
      src="https://utteranc.es/client.js"
      repo="{{ site.Params.utterancesRepo }}"
      issue-term="og:title"
      theme="github-light"
      crossorigin="anonymous"
      async>
    </script>
  </article>
</template>
{{ end }}

{{ if site.Params.valine }}
<article>
{{ if fileExists "layouts/partials/valine.html" }}
  {{ partialCached "valine.html" . }}
{{ else }}
  <div id="vcomments"></div>
  <script>
    new Valine({
      el: '#vcomments',
      appId: '{{ site.Params.LEANCLOUD_APP_ID }}',
      appKey: '{{ site.Params.LEANCLOUD_APP_KEY }}'
    })
  </script>
{{ end }}
</article>
{{ end }}

{{ if site.Params.waline }}
<article>
{{ if fileExists "layouts/partials/waline.html" }}
  {{ partialCached "waline.html" . }}
{{ else }}
  <div id="waline"></div>
  <script type="module">
    import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';

    init({
      el: '#waline',
      dark: 'html.dark',
      serverURL: {{ site.Params.walineServer }},
    });
  </script>
{{ end }}
</article>
{{ end }}
